package cn.wolfcode.crm.service;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import cn.wolfcode.crm.util.PageResult;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface IEmployeeService {

    void saveOrUpdate(Employee entity);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();


    void changState(Long id);

    PageResult quey4List(EmployeeQueryObject qo);

    void resetpassword(Employee entity);

    Employee getEmployeeByUsername(String username);

    void importXls(MultipartFile file, HttpServletResponse response) throws Exception;

    //获取导入模板
    Workbook getImportXlsMode();

    /**
     * 根据qo条件在实现类中将xls查询返回
     *
     * @param qo
     * @return
     */
    Workbook exportXls(EmployeeQueryObject qo);

    //查询所有班主任
    List<Employee> selectAllClassManager();

    //查询所有老师
    List<Employee> selectAllTeacher();

    //查询所有营销人员
    List<Employee> selectAllSalesman();

    //查询所有收款人
    List<Employee> selectAllIncomMan();

    /**
     * 通过角色的sn查询对应员工集合
     *
     * @param roleSn
     * @return员工对象集合
     */
    List<Employee> selectEmpByRolesn(String roleSn);

    /**
     * 根据当前时间记录用户登陆的时间
     * @param employee
     */
    void markLoginDate(Employee employee);
}
